<template>
    <div class="add_box">
        <input type="text" placeholder="待办事项" v-model="task"><button :style="{background: $store.state.backColor}" @click="changeTasks(task)">提交</button>
    </div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
  name: '',
  data() { 
    return {
        task: ''
    }
  },
  created() {

  },
  methods:{
      ...mapMutations(['changeTasks'])
  },
 }
</script>

<style scoped lang="scss">
.add_box {
    display: flex;
    height: 80px;
    width: 100%;
    align-items: center;
    button {
        width: 70px;
        text-align: center;
        color: #fff;
        margin-left: 10px;
        height: 40px;
        border: none;
        border-radius: 6px;
    }
    input {
        width: calc(100% - 80px);
        height: 40px;
        border-radius: 6px;
        border: 2px solid #ccc;
        padding-left: 10px;
    }

    button, input {
        outline: none;
    }
}
</style>